﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;

namespace PurchaseSales.Manage.Common
{
    public static class AppConfig
    {
        public static bool SchemaUpdate
        {
            get
            {
                bool result = false;
                bool.TryParse(ConfigurationManager.AppSettings["SchemaUpdate"], out result);
                return result;
            }
        }

        public static string ConnectionString
        {
            get
            {
                var connectionString = ConfigurationManager.ConnectionStrings["connectionString"].ConnectionString;
                return connectionString;
            }
        }

        /// <summary>
        /// 获取所有应用程序模块
        /// </summary>
        public static string[] Modules
        {
            get { return ConfigurationManager.AppSettings["AllModules"].Split(',').Select(x => x.Trim()).ToArray(); }
        }
    }
}
